package org.shilong.logic.party;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.shilong.Utilitys.Strings.Constants;
import org.shilong.mContext.db.DBContext;
import org.shilong.model.AccountModel;

public class QueryPeopleTakeInParty {

	private static List<AccountModel> mList = null;


	public static List<AccountModel> getRlt( String... args ){

		mList = null;

		mList = new ArrayList<AccountModel>();

		Connection conn = null;

		CallableStatement cst = null;

		ResultSet rs = null;

		conn = DBContext.createInstance( DBContext.TYPE_MYSQL ).getConnector();

		try {
			cst = conn.prepareCall( Constants.QUERY_PARTY_CY );

			cst.setInt( 1, Integer.valueOf( args[0]) );

			rs = cst.executeQuery();

			while( rs.next() ){
				AccountModel  bean = new AccountModel();

				bean.setAccount_name( rs.getString( "account_name" ) );

				mList.add( bean );

			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally{

			try {

				rs.close();
				rs =null;

				cst.close();
				cst = null;

			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return mList;
	}
}
